package com.maxd.respository.userMoney;

import com.maxd.model.UserMoneyDetails;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface UserMoneyDetailsRepository extends Repository<UserMoneyDetails, Long> {

    @Query(value = "select * from user_money_details t where t.user_id=:userId",
            countQuery = "select count(*) from user_money_details t where t.user_id=:userId"
            ,nativeQuery = true)
    List<UserMoneyDetails> selectById(@Param("userId") Long userId, Pageable pageable);

}
